home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / vbcc / machines / amiga68k / vconfig / menu_code.c < prev    next >
Encoding:
Text File  |  1998-06-24  |  2.2 KB  |  100 lines

  1. int codeMenu(void)
  2. {
  3.     int retval = 0;
  4.  
  5.     printf("\fCode generation settings.\n");
  6.     printf("-------------------------\n");
  7.  
  8.     printf("1. CPU: %s             ", cpuname[cpuCode]);
  9.     printf("2. Floating point: %s\n", fpuname[fpuCode]);
  10.     printf("3. Code model: %s      ", modelname[codemodel]);
  11.     printf("4. Data model: %s\n", modelname[datamodel]);
  12.     printf("5. %s\n\n", docompilename[compileMethod]);
  13.  
  14.  
  15.     back_help_quit();
  16.  
  17.     switch(getch())
  18.     {
  19. /*        char buf[255];*/
  20.  
  21.         case '1': add(cpuCode, 5);
  22.                   updateLibList();
  23.                   break;
  24.  
  25.         case '2': add(fpuCode, 2);
  26.                   updateLibList();
  27.                   break;
  28.  
  29.         case '3': negate(codemodel); break;
  30.  
  31.         case '4': negate(datamodel);
  32.                   if(datamodel == SMALL)
  33.                   {
  34.                       addLib("vcs");
  35.                       addLib("amigas");
  36.                   }
  37.                   else
  38.                   {
  39.                       removeLib("vcs");
  40.                       removeLib("amigas");
  41.                   }
  42.                   break;
  43.  
  44.         case '5': add(compileMethod, 3); break;
  45.  
  46.  
  47.         case 'h':
  48.         case 'H': help(CODE); break;
  49.  
  50.         case ESC:
  51.         case 'b':
  52.         case 'B': retval = 1;
  53.                   break;
  54.  
  55.         case 'q':
  56.         case 'Q': exit(0);
  57.  
  58.     }
  59.  
  60.     return(retval);
  61. }
  62.  
  63.  
  64. /*
  65. ** maintaining the different libs to be linked with when floating
  66. ** point is being used.
  67. */
  68. void updateLibList(void)
  69. {
  70.     removeLib("mieee");
  71.     removeLib("m881");
  72.     removeLib("m040");
  73.     removeLib("m060");
  74.  
  75.     if(fpuCode == 1)
  76.         addLib("mieee");
  77.  
  78.     if(fpuCode == 2)
  79.     {
  80.         switch(cpuCode)
  81.         {
  82.             case 0:                        /* 000 */
  83.             case 1: addLib("mieee"); break;/* 010 */
  84.             case 2:                        /* 020 */
  85.             case 3: addLib("m881"); break; /* 030 */
  86.  
  87.             case 4:                        /* 040 */
  88.             case 5: addLib("m040"); break; /* 060 */
  89.  
  90. /* WILL BE ADDED WHEN 060 is supported
  91.             case 4: addLib("m040"); break; * 040 *
  92.             case 5: addLib("m060"); break; * 060 *
  93. */
  94.  
  95.         }
  96.     }
  97. }
  98.  
  99.  
  100.